	list	p=pic16f84a, r=dec
	org	0
	goto	_start
	org	4
	goto	interrupt
_STATUS	equ	3
_C	equ	0
_Z	equ	2
_PCL	equ	2
_PCLATH	equ	10
_TMR0	equ	1
_INTCON	equ	11
_OPTION	equ	129
PIC16F84_static	equ	18
Processor_static	equ	18
TaskTest_static	equ	18
Task_static	equ	24
PIC16F84__PORTA	equ	18
PIC16F84__PORTB	equ	18
PIC16F84__EEDATA	equ	18
PIC16F84__EEADR	equ	18
PIC16F84__TRISA	equ	18
PIC16F84__TRISB	equ	18
PIC16F84__EECON1	equ	18
PIC16F84__EECON2	equ	18
PIC16F84__C	equ	18
PIC16F84__Z	equ	18
PIC16F84__W	equ	18
PIC16F84__F	equ	18
PIC16F84__TMR0	equ	18
PIC16F84__PCL	equ	18
PIC16F84__STATUS	equ	18
PIC16F84__FSR	equ	18
PIC16F84__PCLATH	equ	18
PIC16F84__INTCON	equ	18
PIC16F84__OPTION	equ	18
TaskTest_i	equ	18
TaskTest_ii	equ	19
TaskTest_j	equ	20
TaskTest_tmo	equ	22
Task_first	equ	24
Task_current	equ	25
Task_tmp	equ	26
Task_next	equ	0
Task_timer	equ	1
Task_PC	equ	3
PIC16F84__setMemory_II_V_loc	equ	27
PIC16F84__setMemory_II_V_tmp	equ	29
PIC16F84__getMemory_I_I_loc	equ	27
PIC16F84__getMemory_I_I_tmp	equ	28
PIC16F84__asm_Str_loc	equ	27
PIC16F84__asm_Str_tmp	equ	28
PIC16F84__initline_Str_loc	equ	27
PIC16F84__initline_Str_tmp	equ	28
PIC16F84__clock_I_V_loc	equ	27
PIC16F84__clock_I_V_tmp	equ	28
PIC16F84__heap_I_V_loc	equ	27
PIC16F84__heap_I_V_tmp	equ	28
PIC16F84__memory_II_V_loc	equ	27
PIC16F84__memory_II_V_tmp	equ	29
PIC16F84__banksize_I_V_loc	equ	27
PIC16F84__banksize_I_V_tmp	equ	28
PIC16F84__genlabel__V_loc	equ	27
PIC16F84__genlabel__V_tmp	equ	27
PIC16F84__getlabelhigh__I_loc	equ	27
PIC16F84__getlabelhigh__I_tmp	equ	27
PIC16F84__getlabellow__I_loc	equ	27
PIC16F84__getlabellow__I_tmp	equ	27
PIC16F84__printlabel__V_loc	equ	27
PIC16F84__printlabel__V_tmp	equ	27
PIC16F84__init___V_loc	equ	27
PIC16F84__init___V_tmp	equ	28
Processor__init___V_loc	equ	30
Processor__init___V_tmp	equ	31
TaskTest__init___V_loc	equ	32
TaskTest__init___V_tmp	equ	33
TaskTest_main__V_loc	equ	32
TaskTest_main__V_tmp	equ	32
TaskTest_task1__V_loc	equ	27
TaskTest_task1__V_tmp	equ	27
TaskTest_task2__V_loc	equ	27
TaskTest_task2__V_tmp	equ	27
TaskTest_stop__V_loc	equ	27
TaskTest_stop__V_tmp	equ	27
TaskTest__clinit___V_loc	equ	27
TaskTest__clinit___V_tmp	equ	27
Task_run__V_loc	equ	28
Task_run__V_tmp	equ	28
Task__init__Str_loc	equ	35
Task__init__Str_tmp	equ	37
Task_sleep_J_V_loc	equ	31
Task_sleep_J_V_tmp	equ	33
Task_schedule__V_loc	equ	28
Task_schedule__V_tmp	equ	28
Task_interrupt__V_loc	equ	28
Task_interrupt__V_tmp	equ	28
Task__clinit___V_loc	equ	27
Task__clinit___V_tmp	equ	27
_FSR_TEMP	equ	12
_ACC	equ	13
_HEAP	equ	14
_ACC_TEMP	equ	15
_STATUS_TEMP	equ	16
_W_TEMP	equ	17
_start
	movlw	79
	movwf	_HEAP
	call	TaskTest__clinit___V
	call	Task__clinit___V
	goto	main
clockspeed	equ	4000000
; tmr0 count = 250
tmr0_for_1ms	equ	6
; prescaler = 4
set_prescaler_for_1ms	macro
	bcf	_OPTION,2
	bcf	_OPTION,1
	bsf	_OPTION,0
	endm

PIC16F84__init___V
	;;; aload_0
	;;; invokespecial
	;;; ldc
	;;; invokestatic
	;;; ldc
	;;; invokestatic
	;;; ldc
	;;; invokestatic
	;;; ldc
	;;; invokestatic
	;;; ldc
	;;; invokestatic
	;;; ldc
	;;; invokestatic
	;;; ldc
	;;; invokestatic
	;;; ldc
	;;; invokestatic
	;;; ldc
	;;; invokestatic
	;;; ldc
	;;; invokestatic
	;;; ldc
	;;; invokestatic
	;;; ldc
	;;; invokestatic
	;;; ldc
	;;; invokestatic
	;;; bipush
	;;; bipush
	;;; invokestatic
	;;; bipush
	;;; invokestatic
	;;; sipush
	;;; invokestatic
	;;; return
	return

Processor__init___V
	;;; aload_0
	;;; invokespecial
	;;; return
	return

TaskTest__init___V
	;;; aload_0
	;;; invokespecial
	;;; return
	return

TaskTest_main__V
main
	;;; new
	movlw	5
bseladdr	set	_HEAP
	banksel	bseladdr
	subwf	_HEAP,1
	movf	_HEAP,0
	;;; dup
	movwf	TaskTest_main__V_tmp+0
	;;; ldc
	;;; invokespecial
	movf	TaskTest_main__V_tmp+0,0
	movwf	Task__init__Str_loc+0
	addlw	Task_PC
	movwf	4
	movlw	HIGH TaskTest_task1__V
	movwf	0
	incf	4,1
	movlw	LOW TaskTest_task1__V
	movwf	0
	call	Task__init__Str
	;;; pop
	;;; new
	movlw	5
	subwf	_HEAP,1
	movf	_HEAP,0
	;;; dup
	movwf	TaskTest_main__V_tmp+0
	;;; ldc
	;;; invokespecial
	movf	TaskTest_main__V_tmp+0,0
	movwf	Task__init__Str_loc+0
	addlw	Task_PC
	movwf	4
	movlw	HIGH TaskTest_task2__V
	movwf	0
	incf	4,1
	movlw	LOW TaskTest_task2__V
	movwf	0
	call	Task__init__Str
	;;; pop
	;;; ldc
	;;; invokestatic
	;;; invokestatic
	call	Task_run__V
	;;; return
	return

TaskTest_task1__V
	;;; goto
	goto	TaskTest_task1__V_3
TaskTest_task1__V_3
	;;; getstatic
	;;; invokestatic
bseladdr	set	Task_current
	banksel	bseladdr
	movf	Task_current,0
	addlw	Task_timer
	movwf	4
	movf	TaskTest_tmo,0
	movwf	0
	incf	4,1
	movf	TaskTest_tmo+1,0
	movwf	0
	incf	4,1
	movlw	HIGH label1
	movwf	0
	incf	4,1
	movlw	LOW label1
	movwf	0
	goto	Task_schedule__V
label1
	;;; getstatic
	;;; ldc2_w
	;;; lcmp
bseladdr	set	TaskTest_j
	banksel	bseladdr
	movf	TaskTest_j,0
	sublw	0
	btfsc	_STATUS,_Z
	goto	TaskTest_task1__V_15_low_byte
	movlw	0xff
	btfss	_STATUS,_C
	movlw	1
	goto	TaskTest_task1__V_15_end
TaskTest_task1__V_15_low_byte
bseladdr	set	TaskTest_j+1
	banksel	bseladdr
	movf	TaskTest_j+1,0
	sublw	50
	movlw	0
	btfsc	_STATUS,_Z
	goto	TaskTest_task1__V_15_end
	movlw	0xff
	btfss	_STATUS,_C
	movlw	1
TaskTest_task1__V_15_end
	;;; iflt
	iorlw	0
	btfsc	_STATUS,_Z
	goto	$+4
	andlw	128
	btfss	_STATUS,_Z
	goto	TaskTest_task1__V_3
	;;; invokestatic
	banksel	_ACC
	call	TaskTest_stop__V
	;;; goto
	goto	TaskTest_task1__V_3

TaskTest_task2__V
	;;; goto
	goto	TaskTest_task2__V_3
TaskTest_task2__V_3
	;;; ldc2_w
	;;; invokestatic
bseladdr	set	Task_current
	banksel	bseladdr
	movf	Task_current,0
	addlw	Task_timer
	movwf	4
	movlw	39
	movwf	0
	incf	4,1
	movlw	16
	movwf	0
	incf	4,1
	movlw	HIGH label2
	movwf	0
	incf	4,1
	movlw	LOW label2
	movwf	0
	goto	Task_schedule__V
label2
	;;; getstatic
	;;; lconst_1
	;;; ladd
	;;; check acc
	;;; pop a
	;;; pop b
	;;; load a hi
	movlw	0
	;;; start adding
bseladdr	set	TaskTest_j
	banksel	bseladdr
	addwf	TaskTest_j,0
	movwf	_ACC
	;;; load a lo
	movlw	1
	;;; continue adding
	addwf	TaskTest_j+1,0
	btfsc	_STATUS,_C
	incf	_ACC,1
	;;; push to stack
	;;; putstatic
	movwf	TaskTest_j+1
	movf	_ACC,0
	movwf	TaskTest_j
	;;; goto
	goto	TaskTest_task2__V_3

TaskTest_stop__V
	;;; goto
	goto	TaskTest_stop__V_3
TaskTest_stop__V_3
	;;; goto
	goto	TaskTest_stop__V_3

TaskTest__clinit___V
	;;; iconst_0
	;;; putstatic
	movlw	0
	movwf	TaskTest_i
	;;; iconst_0
	;;; putstatic
	movlw	0
	movwf	TaskTest_ii
	;;; lconst_0
	;;; putstatic
	movlw	0
	movwf	_ACC
	movlw	0
	movwf	TaskTest_j+1
	movf	_ACC,0
	movwf	TaskTest_j
	;;; ldc2_w
	;;; putstatic
	movlw	0
	movwf	_ACC
	movlw	100
	movwf	TaskTest_tmo+1
	movf	_ACC,0
	movwf	TaskTest_tmo
	;;; return
	return

Task_run__V
	;;; getstatic
	;;; putstatic
	movf	Task_first,0
	movwf	Task_current
	;;; ldc
	;;; invokestatic
    banksel _OPTION
	;;; ldc
	;;; invokestatic
    bcf     _OPTION,5
	;;; ldc
	;;; invokestatic
    bcf     _OPTION,3
	;;; ldc
	;;; invokestatic
    set_prescaler_for_1ms
	;;; ldc
	;;; invokestatic
    banksel _INTCON
	;;; ldc
	;;; invokestatic
    bcf     _INTCON,2
	;;; ldc
	;;; invokestatic
    bsf     _INTCON,5
	;;; ldc
	;;; invokestatic
    bsf     _INTCON,7
	;;; ldc
	;;; invokestatic
    goto    Task_schedule__V
	;;; return
	return

Task__init__Str
	;;; aload_0
	;;; invokespecial
	;;; aload_0
	;;; getstatic
	;;; putfield
	movf	Task__init__Str_loc+0,0
	addlw	Task_next                          ; add field offset
	movwf	4
	movf	Task_first,0
	movwf	0                                  ; putfield
	;;; aload_0
	;;; putstatic
	movf	Task__init__Str_loc+0,0
	movwf	Task_first
	;;; aload_0
	;;; lconst_0
	;;; putfield
	movf	Task__init__Str_loc+0,0
	addlw	Task_timer                         ; add field offset
	movwf	4
	movlw	0
	movwf	0                                  ; put the msb
	incf	4,1                                 ; pointer for the lsb
	movlw	0
	movwf	0                                  ; put the lsb
	;;; return
	return

Task_sleep_J_V
	;;; return
	return

Task_schedule__V
	;;; ldc
	;;; invokestatic
    banksel Task_current
	;;; ldc
	;;; invokestatic
scheduleloop
	;;; ldc
	;;; invokestatic
    clrwdt
	;;; ldc
	;;; invokestatic
    movf    Task_current,0
	;;; ldc
	;;; invokestatic
    movwf   4
	;;; ldc
	;;; invokestatic
    movf    0,0
	;;; ldc
	;;; invokestatic
    btfsc   _STATUS,_Z
	;;; ldc
	;;; invokestatic
    movf    Task_first,0
	;;; ldc
	;;; invokestatic
    movwf   Task_current
	;;; ldc
	;;; invokestatic
    movwf   4
	;;; ldc
	;;; invokestatic
    incf    4,1
	;;; ldc
	;;; invokestatic
    movf    0,0
	;;; ldc
	;;; invokestatic
    btfss   _STATUS,_Z
	;;; ldc
	;;; invokestatic
    goto    scheduleloop
	;;; ldc
	;;; invokestatic
    incf    4,1
	;;; ldc
	;;; invokestatic
    movf    0,0
	;;; ldc
	;;; invokestatic
    btfss   _STATUS,_Z
	;;; ldc
	;;; invokestatic
    goto    scheduleloop
	;;; ldc
	;;; invokestatic
    incf    4,1
	;;; ldc
	;;; invokestatic
    movf    0,0
	;;; ldc
	;;; invokestatic
    movwf   _PCLATH
	;;; ldc
	;;; invokestatic
    incf    4,1
	;;; ldc
	;;; invokestatic
    movf    0,0
	;;; ldc
	;;; invokestatic
    movwf   _PCL
	;;; return
	return

Task_interrupt__V
	;;; ldc
	;;; invokestatic
    movf    Task_first,0
	;;; ldc
	;;; invokestatic
    movwf   Task_tmp
	;;; ldc
	;;; invokestatic
Task_loop
	;;; ldc
	;;; invokestatic
    movf    Task_tmp,0
	;;; ldc
	;;; invokestatic
    btfsc   _STATUS,_Z
	;;; ldc
	;;; invokestatic
    goto    Task_end
	;;; ldc
	;;; invokestatic
    movwf   4
	;;; ldc
	;;; invokestatic
    movf    0,0
	;;; ldc
	;;; invokestatic
    movwf   Task_tmp
	;;; ldc
	;;; invokestatic
    incf    4,1
	;;; ldc
	;;; invokestatic
    movf    0,0
	;;; ldc
	;;; invokestatic
    btfss   _STATUS,_Z
	;;; ldc
	;;; invokestatic
    goto    Task_decrement
	;;; ldc
	;;; invokestatic
    incf    4,1
	;;; ldc
	;;; invokestatic
    movf    0,0
	;;; ldc
	;;; invokestatic
    btfss   _STATUS,_Z
	;;; ldc
	;;; invokestatic
    decf    0,1
	;;; ldc
	;;; invokestatic
    goto    Task_loop
	;;; ldc
	;;; invokestatic
Task_decrement
	;;; ldc
	;;; invokestatic
    incf    4,1
	;;; ldc
	;;; invokestatic
    decf    0,1
	;;; ldc
	;;; invokestatic
    movf    0,0
	;;; ldc
	;;; invokestatic
    sublw   255
	;;; ldc
	;;; invokestatic
    btfss   _STATUS,_Z
	;;; ldc
	;;; invokestatic
    goto    Task_loop
	;;; ldc
	;;; invokestatic
    decf    4,1
	;;; ldc
	;;; invokestatic
    decf    0,1
	;;; ldc
	;;; invokestatic
    goto    Task_loop
	;;; ldc
	;;; invokestatic
Task_end
	;;; ldc
	;;; invokestatic
    movlw   tmr0_for_1ms
	;;; ldc
	;;; invokestatic
    movwf   _TMR0
	;;; ldc
	;;; invokestatic
    bcf     _INTCON,2
	;;; ldc
	;;; invokestatic
    bsf     _INTCON,5
	;;; return
	return

Task__clinit___V
	;;; aconst_null
	;;; putstatic
	movlw	0
	movwf	Task_first
	;;; aconst_null
	;;; putstatic
	movlw	0
	movwf	Task_current
	;;; return
	return
interrupt
	movwf	_W_TEMP
	swapf	_STATUS,0
	movwf	_STATUS_TEMP
	movf	_ACC,0
	movwf	_ACC_TEMP
	movf	4,0
	movwf	_FSR_TEMP
	banksel	_ACC
	call	Task_interrupt__V

	movf	_FSR_TEMP,0
	movwf	4
	movf	_ACC_TEMP,0
	movwf	_ACC
	swapf	_STATUS_TEMP,0
	movwf	_STATUS
	swapf	_W_TEMP,1
	swapf	_W_TEMP,0
	retfie
	end
